home *** CD-ROM | disk | FTP | other *** search
- global gindexmaplist, ggridlist, theBlitPict, gKeywordDataList, gmasterfolderpath, gFileName, objIndexBtn, gIndexRectList, objalphabetbtn, glastline, gkeywordtext, gSelLine, glineoffset, gColor, objCaptureGrid
-
- on startindex
- set the mouseDownScript to "indexMouseDownScript"
- repeat with m = 1 to count(gindexmaplist)
- set theList to getAt(gindexmaplist, m)
- drawIndexBtn(m, count(theList), #GRAY)
- repeat with n = 1 to count(theList)
- if getAt(theList, n) = 1 then
- drawIndexBtn(m, n, #BLUE)
- end if
- end repeat
- end repeat
- blitPictInitScreen(theBlitPict, getAt(ggridlist, 6))
- blitPictDrawObj(theBlitPict, the srcrect of theBlitPict, the POINTER of objCaptureGrid, the srcrect of objCaptureGrid, "copy")
- blitPictDispose(theBlitPict)
- if gSelLine = 0 then
- showKeyword(1, 0)
- else
- showKeyword(gSelLine, 1)
- drawkeywords(gSelLine)
- end if
- end
-
- on drawkeywords selectedkeyword
- blitPictDrawScreen(objCaptureGrid, the srcrect of objCaptureGrid, getAt(ggridlist, 6), "copy", 0, 0)
- repeat with keywordData in getAt(gKeywordDataList, selectedkeyword)
- drawIndexBtn(getAt(keywordData, 1), getAt(keywordData, 2), #YELLOW)
- end repeat
- end
-
- on killCaptureGrid
- blitPictDispose(objCaptureGrid)
- end
-
- on setIndexBtn
- set pictfilepath to gmasterfolderpath & getProp(gFileName, #INDEXBTN)
- blitPictInitFile(objIndexBtn, pictfilepath)
- set gIndexRectList to [:]
- addProp(gIndexRectList, #GRAY, "0,0,12,12")
- addProp(gIndexRectList, #BLUE, "324,0,336,12")
- addProp(gIndexRectList, #YELLOW, "336,0,348,12")
- set pictfilepath to gmasterfolderpath & getProp(gFileName, #Alphabet)
- blitPictInitFile(objalphabetbtn, pictfilepath)
- blitPictInitScreen(objCaptureGrid, getAt(ggridlist, 6))
- end
-
- on drawIndexBtn lesson, Chapter, theButton
- if theButton = #GRAY then
- set srcrect to "0,0," & 12 * Chapter & ",12"
- set theL to getAt(ggridlist, 1)
- set theT to getAt(ggridlist, 2) + ((lesson - 1) * 12)
- blitPictDrawScreen(objIndexBtn, srcrect, theL & "," & theT & "," & theL + (12 * Chapter) & "," & theT + 12, "copy", 0, 0)
- else
- set srcrect to getProp(gIndexRectList, theButton)
- set theL to getAt(ggridlist, 1) + ((Chapter - 1) * 12)
- set theT to getAt(ggridlist, 2) + ((lesson - 1) * 12)
- blitPictDrawScreen(objIndexBtn, srcrect, theL & "," & theT & "," & theL + 12 & "," & theT + 12, "copy", 0, 0)
- end if
- end
-
- on killIndexBtn
- blitPictDispose(objIndexBtn)
- blitPictDispose(objalphabetbtn)
- end
-
- on showKeyword lineNumber, switchOn
- set the foreColor of cast 34 to getAt(gColor, 4)
- if glastline > 24 then
- if lineNumber < 3 then
- set glineoffset to 0
- set the text of cast 34 to line 1 to 23 of gkeywordtext & RETURN
- set the visible of sprite 30 to 0
- set the visible of sprite 31 to 1
- updateStage()
- if switchOn then
- set the foreColor of line lineNumber of cast 34 to getAt(gColor, 5)
- end if
- else
- if (lineNumber + 23) > glastline then
- set glineoffset to glastline - 24
- set theText to line glastline - 22 to glastline of gkeywordtext
- set the text of cast 34 to RETURN & theText
- set the visible of sprite 30 to 1
- set the visible of sprite 31 to 0
- updateStage()
- if switchOn then
- set the foreColor of line lineNumber - glineoffset of cast 34 to getAt(gColor, 5)
- end if
- else
- set glineoffset to lineNumber - 2
- set theText to line lineNumber to lineNumber + 21 of gkeywordtext
- set the text of cast 34 to RETURN & theText & RETURN
- set the visible of sprite 30 to 1
- set the visible of sprite 31 to 1
- updateStage()
- if switchOn then
- set the foreColor of line 2 of cast 34 to getAt(gColor, 5)
- end if
- end if
- end if
- else
- set the visible of sprite 30 to 0
- set the visible of sprite 31 to 0
- updateStage()
- set the text of cast 34 to gkeywordtext
- set the foreColor of cast 34 to getAt(gColor, 4)
- if switchOn then
- set the foreColor of line lineNumber of cast 34 to getAt(gColor, 5)
- end if
- end if
- end
-